package getGaokaoXuankeData.controller;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TestController {
    public static void main(String[] args) {
//        String regEx ="a";
//
//        //检测要匹配的单词，单词的前面必须是空格或者标点符号
//        Pattern pattern = Pattern.compile("[^\\w]"+regEx+"[^\\w]");
//        //String jz = "talla ~ grande/pequeña/mediana/única";
//        String jz = "I have the banaña.";
//
//        Matcher matcher = pattern.matcher(jz);
//
//        boolean result= matcher.find();
//
//        System.out.println(result);
        test();
    }
    public static void test(){
        String str="the ca+t scattered his food catch mcat";
        String re = "ca";
        Pattern p=Pattern.compile("\\b"+re+"\\b");
        Matcher m=p.matcher(str);
        boolean b = m.find();
        System.out.println(b);

    }


}
